/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { ResponseItem, responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  'POST /CustomerServiceV2/getStorageLocList': (req: Request, res: Response) => {
    const { status } = req.body;
    const data = Mock.mock({
      'list|1-20': [
        {
          id: '@id()',
          cm_id: '@id()',
          cm_phone: '@phone()', //快递员账号
          title: '@city()', //位置名称
          status,
          location: '@city()', //详细地址
          create_time: '@date()', //修改时间（应申请时间）
          province: '上海市',
          city: '上海',
          district: '长宁区',
          town: '北新泾',
          approve_time: null,
          operator: null,
          lng: '111',
          lat: '222',
          'is_deduct_not_send|1': [0, 1],
        },
      ],
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: {
        data: data.list,
        total: data.list.length,
      },
    };
    return res.json(result);
  },
  'POST /CustomerServiceV2/approveStorageLoc': (req: Request, res: Response) =>
    responseSuccess(req, res),
};
